<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../../../../lib/layui-v2.5.5/css/layui.css" media="all">
    <link rel="stylesheet" href="../../../../css/public.css" media="all">
</head>
<body>
<div class="layuimini-container">

    <div class="layuimini-main">
        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;">
            <legend>请输入器材信息</legend>
        </fieldset>

        <form class="layui-form layui-form-pane" action="">

            <div class="layui-form-item">
                <div class="layui-inline">
                <label class="layui-form-label">使用表ID</label>
                <div class="layui-input-inline">
                    <input type="text" id="uid" lay-verify="required" placeholder="请输入" autocomplete="off"
                           class="layui-input">
                </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">临床试验表编号</label>
                    <div class="layui-input-inline">
                        <input type="text" id="eid" lay-verify="required" placeholder="请输入" autocomplete="off"
                               class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">器材编号</label>
                    <div class="layui-input-inline">
                        <input type="text" id="meid" lay-verify="required" placeholder="请输入" autocomplete="off"
                               class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">器材名称</label>
                    <div class="layui-input-inline">
                        <input type="text" id="mename" lay-verify="required" placeholder="请输入" autocomplete="off"
                               class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">医生编号</label>
                    <div class="layui-input-inline">
                        <input type="text" id="did" lay-verify="required" placeholder="请输入" autocomplete="off"
                               class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">医生姓名</label>
                    <div class="layui-input-inline">
                        <input type="text" id="dname" lay-verify="required" placeholder="请输入" autocomplete="off"
                               class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">患者编号</label>
                    <div class="layui-input-inline">
                        <input type="text" id="pid" lay-verify="required" placeholder="请输入" autocomplete="off"
                               class="layui-input">
                    </div>
                </div>

                <div class="layui-inline">
                    <label class="layui-form-label">患者姓名</label>
                    <div class="layui-input-inline">
                        <input type="text" id="pname" lay-verify="required" placeholder="请输入" autocomplete="off"
                               class="layui-input">
                    </div>
                </div>

                <div class="layui-inline">
                    <label class="layui-form-label">备注</label>
                    <div class="layui-input-inline">
                        <input type="text" id="remark" lay-verify="required" placeholder="请输入" autocomplete="off"
                               class="layui-input">
                    </div>
                </div>
                </div>
            
            <div class="layui-form-item">
                <button class="layui-btn" lay-submit="" lay-filter="saveBtn" style="width: 200px">添加</button>
            </div>
        </form>
    </div>
</div>

<script src="../../../../lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script src="../../../../js/lay-config.js?v=1.0.4" charset="utf-8"></script>
<script>
    layui.use(['table', 'form', 'tableSelect'], function () {
        var $ = layui.jquery,
            table = layui.table,
            form = layui.form,
            tableSelect = layui.tableSelect;



    });
</script>
<script>
    layui.use(['form', 'layedit', 'laydate'], function () {
        var form = layui.form
            , layer = layui.layer
            , layedit = layui.layedit
            , laydate = layui.laydate,
            $ = layui.jquery,
            table = layui.table,
            layuimini = layui.layuimini;
        var userInfo = layui.data('userInfo');



        //监听提交
        form.on('submit(saveBtn)', function (data) {

            var index = layer.alert("确定要提交吗?", {
                title: '确认提交'
            }, function () {

                $.ajax({
                    url:'http://localhost:8080/equipment_use/AddEquipment_use',
                    method:'post',
                    data:{
                        uid: $('#uid').val(),
                        eid: $('#eid').val(),
                        meid: $('#meid').val(),
                        did: $('#did').val(),
                        pid: $('#pid').val(),
                        mename: $('#mename').val(),
                        pname: $('#pname').val(),
                        dname: $('#dname').val(),
                        remark: $('#remark').val(),
                    },
                    async: true,
                    dataType:'JSON',
                    success:function(res){

                    },
                    error: function(XMLHttpRequest, textStatus, errorThrown) {
                    }
                }) ;

                // 关闭弹出层
                layer.close(index);
                var iframeIndex = parent.layer.getFrameIndex(window.name);
                parent.layer.close(iframeIndex);
                // 关闭弹出层
                layer.close(index);

                var iframeIndex = parent.layer.getFrameIndex(window.name);
                parent.layer.close(iframeIndex);

            });

            return false;

        });



    });
</script>

</body>
</html>